<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>{block name="title"}{$setting['sitename']}{/block}</title>
    <link rel="stylesheet" href="__CSS__/bootstrap.min.css">
    <style>
        a {
            text-decoration: none;
            color: #333;
        }
        a:hover{
            color: #333;
        }
        .swal-footer{
            text-align: center;
        }
    </style>
</head>
<body>
<div class="container">
    {include file='navbar'}

    {block name="main"}主内容{/block}

    {include file='footer'}
</div>
<script src="__JS__/core/jquery.3.2.1.min.js"></script>
<script src="__JS__/core/bootstrap.min.js"></script>
<script src="__JS__/plugin/sweetalert/sweetalert.min.js"></script>
<script>
    function common(text, url) {
        swal({
            title: '提示',
            text: text,
            type: 'error',
            buttons:{
                cancel: {
                    visible: true,
                    text : '取消',
                    className: 'btn btn-danger'
                },
                confirm: {
                    text : '确定',
                    className : 'btn btn-success'
                }
            }
        }).then((willDelete) => {
            if (willDelete) {
                $.get(url, function (res) {
                    if(res.code == 1) {
                        swal("提示", res.msg, {
                            icon : "success",
                            buttons: {
                                confirm: {
                                    className : 'btn btn-success',
                                    text : '确定',
                                }
                            }
                        }).then(function () {
                            window.location.reload();
                        });
                    }else{
                        swal("提示", res.msg, {
                            icon : "error",
                            buttons: {
                                confirm: {
                                    className : 'btn btn-danger'
                                }
                            },
                        });
                    }
                }, 'json');
            }
        });
    }
</script>
{block name="js"}js内容{/block}
</body>
</html>